cmake_minimum_required (VERSION 2.8)

if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
  add_definitions (-DLUA_USE_LINUX)
endif ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")

# compile lua with the c++ compile in spite of lua
# being c. This enables exception safety for lua errors.
set (CMAKE_C_COMPILER ${CMAKE_CXX_COMPILER})

add_library (lua STATIC
  lapi.c lcode.c lctype.c ldebug.c ldo.c ldump.c lfunc.c lgc.c llex.c 
  lmem.c lobject.c lopcodes.c lparser.c lstate.c lstring.c ltable.c 
  ltm.c lundump.c lvm.c lzio.c
  lauxlib.c lbaselib.c lbitlib.c lcorolib.c ldblib.c liolib.c 
  lmathlib.c loslib.c lstrlib.c ltablib.c loadlib.c linit.c)
